﻿using UnityEngine;
public class EnemyView : CombatantView
{
    public Enemy enemy;

    public void Setup(Enemy enemyd)
    {
        enemy = enemyd;
        MaxHealth = enemy.Health;
        CurrentHealth = enemy.CurrentHealth;
    }


    public override void Damage(int damageAmount)
    {
        // 先执行基类的逻辑
        base.Damage(damageAmount);

        // 再同步数据到 enemy
        if (enemy != null)
        {
            enemy.CurrentHealth = CurrentHealth;
        }
    }
}